package net.goutalk.glcs.module.bi.controller;


import net.goutalk.glcs.common.constant.GlobalConstant;
import net.goutalk.glcs.common.model.result.R;
import net.goutalk.glcs.module.bi.dto.AddVisualReleaseDto;
import net.goutalk.glcs.module.bi.service.IVisualReleaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@AllArgsConstructor
@RestController
@RequestMapping(GlobalConstant.BI_MODULE_PREFIX + "/visual-release")
@Api(value = GlobalConstant.BI_MODULE_PREFIX + "/visual-release", tags = "看板发布模块")
public class VisualReleaseController {


    private final IVisualReleaseService visualReleaseService;


//    @GetMapping("/list")
//    @ApiOperation("查询发布到主页的BI看板")
//    public R list(VisualReleaseListDto dto) {
//        List<VisualRelease> list = visualReleaseService.list(Wrappers.lambdaQuery(VisualRelease.class)
//                .select(VisualRelease.class, x -> VoToColumnUtil.fieldsToColumns(VisualReleaseListVo.class).contains(x.getProperty())));
//        List<VisualReleaseListVo> visualReleaseListVos = BeanUtil.copyToList(list, VisualReleaseListVo.class);
//        return R.ok(visualReleaseListVos);
//    }


    @PostMapping
    @ApiOperation("bi发布菜单")
    public R add(@Valid @RequestBody AddVisualReleaseDto dto){
        return R.ok(visualReleaseService.add(dto));
    }



}
